Consider a computer system in which multiple hosts access an array of disks across a network. At any time, the hosts may be attempting to access the data for read and write operations. In addition, copies of the data may be in progress in which data is being copied from one disk to another by a disk controller that implements a data copy protocol. It would be advantageous to allow the various hosts to continue to read and write data even though the data is being copied from one disk to the other. However, the need to maintain the data in a consistent state causes problems. At the end of the copy operation, both copies of the data should be same.
For the purposes of the present discussion, the disks involved in the copy operation will be referred to as the source and target disks, the data being copied from the source disk to the target disk. There are two situations that can lead to inconsistent data. First consider the case in which a host is reading data that is currently involved in a copy operation. If no preventive action is taken, the host is free to choose either of the source or target disk as the source of the data. If the host chooses the target, part of the data may not have yet been copied, i.e., the host will receive invalid data.
Second, consider the case in which the host is writing data to a region that is currently being copied from the source disk to the target disk. The "write" from the host is directed to both the source and target disks that are concurrently engaged in a copy operation involving the same area of the disks. The source disk will receive one write from the host. The target disk will receive two write messages for the region being copied, one from the source disk and one from the host. Because of unpredictable delays in the network, the order at which the writes arrive at the target disk is uncertain. If the write from the source disk leaves the source before the new data arrives from the host but arrives at the target disk after the write from host arrives, the copies will no longer match, since copy data will overwrite the new data from the host.
To avoid the possibility of data errors, prior art systems utilize a locking mechanism of some type during the copy operation. While the data is being copied, no other read or write operations are allowed. To minimize the cost of this approach, the data being copied is typically divided into three regions, data that has been copied, data that is being copied, and data that has not yet been copied. In this case, the lock is applied only to the regions that are being copied. The lock is moved each time the copy operation is completed on the "being copied" portion of the data. This approach reduces, but does not eliminate, the delays encountered when portions of the data are locked. In addition, the locking mechanism imposes an overhead on the system. The disk system must test for a lock each time an I/O request is received.
Finally, the moving lock approach imposes an order on the copy operations. The data records must be sent in the order they are stored. In some cases, a more efficient order may be possible. For example, the sequence of sectors that can be most rapidly read from the disk may be different from the sequence of records in the file being copied. It would be advantageous to be able to send the records in any order and have the target disk assemble them.
Broadly, it is the object of the present invention to provide an improved method of operating a data storage system in which data is being copied between disks while other computers are reading and writing data to the storage system.
It is a further object of the present invention to provide a method of copying data between disks that does not require the use of a lock that prevents other computers in the system from reading the data during the copy operation.
It is a still further object of the present invention to provide a method for copying data between disks that allows the records to be transferred in an arbitrary order without utilizing a locking mechanism.
These and other objects of the present invention will become apparent to those skilled in the art from the following detailed description of the invention and the accompanying drawings.